home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1993 July / InfoMagic USENET CD-ROM July 1993.ISO / sources / unix / volume26 / ssh-1.7 / part04 < prev    next >
Encoding:
Text File  |  1993-04-15  |  58.9 KB  |  2,159 lines

  1. Newsgroups: comp.sources.unix
  2. From: Steve Baker (ice@judy.indstate.edu)
  3. Subject: v26i170: ssh - Steve's SHell (a small csh-like shell), V1.7, Part04/04
  4. Sender: unix-sources-moderator@vix.com
  5. Approved: paul@vix.com
  6.  
  7. Submitted-By: Steve Baker (ice@judy.indstate.edu)
  8. Posting-Number: Volume 26, Issue 170
  9. Archive-Name: ssh-1.7/part04
  10.  
  11. #! /bin/sh
  12. # This is a shell archive.  Remove anything before this line, then unpack
  13. # it by saving it into a file and typing "sh file".  To overwrite existing
  14. # files, type "sh file -c".  You can also feed this as standard input via
  15. # unshar, or by typing "sh <file", e.g..  If this archive is complete, you
  16. # will see the following message at the end:
  17. #        "End of archive 4 (of 4)."
  18. # Contents:  ssh.1
  19. # Wrapped by vixie@gw.home.vix.com on Thu Apr 15 22:49:02 1993
  20. PATH=/bin:/usr/bin:/usr/ucb ; export PATH
  21. if test -f 'ssh.1' -a "${1}" != "-c" ; then 
  22.   echo shar: Will not clobber existing file \"'ssh.1'\"
  23. else
  24. echo shar: Extracting \"'ssh.1'\" \(57433 characters\)
  25. sed "s/^X//" >'ssh.1' <<'END_OF_FILE'
  26. X.\" $Copyright:    $
  27. X.\" Copyright (c) 1991,1992,1993 by Steve Baker
  28. X.\" All rights reserved
  29. X.\" 
  30. X.\" This software is provided as is without any express or implied
  31. X.\" warranties, including, without limitation, the implied warranties
  32. X.\" of merchantability and fitness for a particular purpose.
  33. X...
  34. X.V= $Header: ssh.1 1.7 1993 $
  35. X.TH SSH 1 "\*(V)" "UNIX Programmer's Manual"
  36. X.SH NAME
  37. ssh \- another UNIX shell
  38. X.SH SYNOPSIS
  39. X.B ssh
  40. X[ \-cefntxvXV ] [ arg ... ]
  41. X.SH DESCRIPTION
  42. X.I Ssh
  43. or Steve's SHell is a implementation of a command line interpreter using
  44. X.I csh
  45. like job control and commands.
  46. X.I Ssh
  47. features advanced alias and variable
  48. parsing, logical assignments, C like mathematical expressions, advanced key
  49. macro support and command line editing with over 20 editing functions,
  50. sophisticated file wildcard expression parsing and an advanced script
  51. language.
  52. X
  53. If an instance of
  54. X.I ssh
  55. is a login shell, it first executes commands found in the file
  56. X.I /etc/.sshrc.
  57. It then checks for the existence of the file
  58. X.I .second
  59. in the users home directory.  If the file exists a password is read out
  60. of the file and the user is prompted for the password.  Failure to enter
  61. the correct password results in the incorrect password and information about
  62. the aborted login attempt to be logged in the file
  63. X.I .warning
  64. which is created if necessary.  If successful the shell checks for the
  65. existence of the
  66. X.I .warning
  67. file and determines how many bad login attempts have been made and notifies
  68. the user.  Next it then begins to read commands from the
  69. X.I .login
  70. file found in the users home directory, then it loads the saved history
  71. from the
  72. X.I .hist
  73. file and finally reads commands from the
  74. X.I .sshrc
  75. file, also found in the users home directory.
  76. X
  77. If it is the case that it is not a login shell, 
  78. X.I ssh
  79. executes the system login file
  80. X.I /etc/.sshrc
  81. then executes the
  82. X.I .sshrc
  83. file found in the users home directory.  The
  84. X.I .sshrc
  85. file in the users home directory may be skipped if the -f command line
  86. option is passed as an argument to
  87. X.I ssh.
  88. X
  89. After successfully logging in, the shell begins to accept input from the
  90. user, prompting with a `>' (or `#' if the user is the superuser), unless
  91. the prompt was changed by the user in either their
  92. X.I .login
  93. or
  94. X.I .sshrc
  95. file.
  96. X
  97. The shell then begins to repeatedly input lines of text from the user.
  98. These lines are placed in the shells history and then broken up into words,
  99. which are parsed each in turn for aliases, variables, logical assignments,
  100. and wildcards.  Finally the words are passed to the executor where it parses
  101. for redirections and pipes and then finally executes the command.
  102. X
  103. XFinally, when the shell terminates, it reads commands out of the
  104. X.I .logout
  105. file located in the users home directory.  Upon executing all the logout
  106. commands the shell exits.
  107. X
  108. X.SH LEXICAL STRUCTURE
  109. X
  110. The shell splits input lines into words at spaces and tabs with the
  111. following exceptions. The characters `;', `&', `|', `<', `>', `(', `)'
  112. as well as the metacharacters `&&', `&!', `&=', `||', `|!', `|&', `|=',
  113. X`>>', `>!', `>>!', `>&', `>>&', `>=', `>>=', `<<', `<<=', `$<', `!=',
  114. X`<%' `<<%', `>%', `>!%', `>&%', `>>%', `>>!%', `>>&%' form single words.
  115. These parser metacharacters may be made part of of other words by escaping
  116. them with backslashs `\\'.
  117. X
  118. In additions, strings enclosed in `'', '`', or '"', form a whole word.
  119. Characters enclosed in these strings, save newline and the `\\' are not
  120. parsed for any other special meaning except inside of double quoted strings
  121. where variable expansion may take place.  The `\\' followed by one of the
  122. following characters is replaced by a non-printing character:
  123. X
  124. X.br
  125. X    \\a     Bell            (Ascii  7)
  126. X.br
  127. X    \\b     Backspace       (Ascii  8)
  128. X.br
  129. X    \\t     Tab             (Ascii  9)
  130. X.br
  131. X    \\n     Newline         (Ascii 10)
  132. X.br
  133. X    \\f     Form Feed       (Ascii 11)
  134. X.br
  135. X    \\r     Carriage return (Ascii 13)
  136. X.br
  137. X    \\e     Escape          (Ascii 27)
  138. X.br
  139. X    \\0xxx  Octal escape
  140. X.br
  141. X
  142. X`\\' may also be used to escape the string quote itself as well and in
  143. double-quoted strings to escape the special meaning of the `$' symbol.
  144. X
  145. Words placed inside of `(' and `)' lose their special meaning to the
  146. shell.  This includes all redirection, piping, background, variable
  147. identifiers, logical assignments, and all other special symbols.
  148. X
  149. XFinally, the `#' at the start of a word starts a comment, where everything
  150. following the `#' is ignored by the shell. If preceded by a `\\' or enclosed
  151. in a string it is prevented it's special meaning.
  152. X
  153. X.SH COMMANDS
  154. X
  155. Simple commands are composed of a sequence of words, the first of which
  156. is the command to be executed.  A pipeline is two or more simple commands
  157. separated by `|', `|!' or `|&' metacharacters to form a complex command.
  158. In pipelines, the output of the first command is redirected into the input
  159. of the next command and so on. Simple commands or complex commands may be
  160. separated by `;' to execute them each in succession.
  161. X
  162. Commands may also be separated by the metacharacters `&&' indicate to the
  163. shell that if the previous command executed correctly, then the second
  164. command is also executed, otherwise it is not.  Commands separated by `||'
  165. indicate that if the previous command executed correctly, then the second
  166. command is not executed, otherwise it is.
  167. X
  168. Commands may also be terminated or separated by `&'or `&!' to prevent the
  169. shell from waiting for the command to terminate. Commands submitted in this
  170. fashion are said to be in the
  171. X.I background
  172. X, as opposed to
  173. X.I foreground
  174. jobs which are waited on to complete and have control of the terminal.
  175. X
  176. X.SH JOBS
  177. X
  178. The shell keeps a table of all jobs that are currently running or stopped
  179. that the user has executed.  This table is printed by use of the builtin
  180. command
  181. X.I jobs.
  182. XEach entry has the form:
  183. X
  184. X.br
  185. X[<\fIjob number\fP>] (<\fIPID\fP>) <\fIstatus\fP>        <\fIjob name\fP>
  186. X
  187. where <\fIjob number\fP> is the logical number the shell assigns to the job.
  188. The job is referenced by this number for the process control commands
  189. X.I bg, fg
  190. and
  191. X.I stop.
  192. The <\fIPID\fP> is the system process ID of the job. <\fIStatus\fP> is the
  193. status of the job, which indicates whether the job is running or stopped
  194. and if it is in the background or foreground.  The <\fIjob name\fP> is the
  195. command word (first word) of the job started.
  196. X
  197. Typing ^Z (control-Z) while running a foreground process usually sends the
  198. stop signal to that processes.  When this happens the process is stopped and
  199. the shell indicates that the job is stopped and return the user to the
  200. command line where they may run other commands or manipulate other jobs.
  201. Stopped jobs may be manipulated with the
  202. X.I fg, bg
  203. and
  204. X.I stop
  205. commands to place them in the foreground or background.
  206. X
  207. A job made to run in the background with the `&' or `&!' metacharacters has
  208. its input and output redirected to `/dev/null', the null device,
  209. automatically if it does not already have preexisting input and output
  210. redirections. This is to insure that background jobs do not attempt to read
  211. from or write to the terminal while you are doing something else. This
  212. automatic redirection to `/dev/null' can be turned off by setting the
  213. X.I nobgnull
  214. shell variable, however it is recommended that if you desire terminal input
  215. or output for background jobs, you explicitly specify such by redirecting
  216. the appropriate descriptors to or from `/dev/tty' which is a system construct
  217. to equate to your current tty (which is also given in the string variable
  218. X.I tty
  219. X). Jobs spawned with `&!' are in addition dissociated from the
  220. terminal entirely and the shell will no longer keep track of these jobs.
  221. This allows the user to spawn a background job, then logout without having
  222. background jobs "hang on" to the tty, sometimes causing inconvenience to
  223. the next user.
  224. X
  225. X.SH COMMAND LINE INPUT
  226. X
  227. The shells input routines support some 20+ editing functions.  None of these
  228. functions are automatically bound to keys however, and should be defined in
  229. the global startup file
  230. X.I .sshrc
  231. in the /usr/etc directory.  These functions can be added, changed or removed
  232. with the use of the
  233. X.I key
  234. and
  235. X.I unkey
  236. builtin commands.  The available editing functions are described briefly
  237. below in the description of the builtin command
  238. X.I key.
  239. X
  240. An example of defining an editing macro:
  241. X.br
  242. X
  243. X     key -f5 "\\010"
  244. X.br
  245. X
  246. This macro defines the backspace key (octal 010) as a delete previous
  247. character (function 5) editing function.  More than one key sequence can be
  248. bound to the same function, thus several keys can be made to delete the
  249. previous character (the author likes to make the backspace and delete
  250. perform the same function because they are very near each other on his
  251. keyboard).
  252. X
  253. Those with function keypads (like most vt100 keyboards), may define keypad
  254. keys as macros for editing or to quickly type out large commands.  An
  255. example of a key macro is assigning control-D to logout the user:
  256. X.br
  257. X
  258. X     key -r -c "\\004" logout
  259. X.br
  260. X
  261. This macro emulates the csh shells logout on EOF.  The `-r' means to make
  262. the input routine act as if the return key has been pressed after the macro
  263. has been inserted onto the command line. The `-c' means to clear the command
  264. line before inserting the macro string.  The "\\004" is the key sequence to
  265. bind the macro string to (in this case ^D), and `logout' is the macro string.
  266. X
  267. The shells macro routines also support the concept of keypad levels and
  268. X`gold keys'.  Keypad levels can be thought of as a stack of keypads, each
  269. with their own macros and function bindings.  The purpose of gold keys is to
  270. change the current keypad level when it is pressed.  An example:
  271. X.br
  272. X
  273. X     key -l0 -g1 "\\033OP"
  274. X.br
  275. X     key -l1 -g0 "\\033OP"
  276. X.br
  277. X
  278. These make the vt100 PF1 key a gold key which toggles between keypad levels
  279. zero and one (level zero is the default).  The `-ln' assigns the gold key to
  280. keypad level
  281. X.I n
  282. and the `-gn' defines the key sequence as a gold key, that when pressed, sets
  283. the keypad to level
  284. X.I n.
  285. The shell maintains a stack of 10 keypad levels (0-9).
  286. X
  287. X.SH STATUS REPORTING
  288. X
  289. The shell performs status reporting of changes in the state of a job in an
  290. asynchronous manner.  If the shell itself does not have control of the
  291. terminal (therefore is waiting for a process to complete), the status of
  292. child processes will not be reported.
  293. X
  294. Should you attempt to logout of your shell while you have stopped jobs, you
  295. will be notified with the message `You have stopped jobs.' and will not
  296. logout. The shell will not alert you a second time however, allowing you to
  297. logout normally.  Any stopped jobs present at logout will no doubt be killed.
  298. X
  299. X.SH SUBSTITUTIONS
  300. X
  301. The following describe the various substitutions of the input line performed
  302. by the shell and in the order that they occur.
  303. X
  304. X.SH COMMAND SUBSTITUTION
  305. X
  306. Commands enclosed in ``' are parsed and executed before any other
  307. substitutions are done on the command line.  The output of these commands is
  308. placed back into the command line in place of the command string.  The
  309. resulting command line is then subject to the remaining substitutions.
  310. X
  311. The output of these commands are normally broken up into words in an
  312. identical fashion as described above in the lexical structure, save that
  313. newlines and null words are discarded.
  314. X
  315. X.SH ALIAS SUBSTITUTION
  316. X
  317. After command substitution is performed, the command line is parsed into
  318. distinct commands, and the first word of each command is scanned to see if
  319. it corresponds to one of the aliases setup by the user.  If a match is
  320. found, the command line is replaced entirely by the alias, placing arguments
  321. into the new command line where indicated by the alias.  An alias contains
  322. switches, signified by a `%', that specify the argument placement desired for
  323. the alias.  These switches are evaluated left to right, and place the words
  324. of the old command line (numbered from 0) into the new command line. When a
  325. word from the old command line is inserted into the new command line, it is
  326. said to have been used.  The following is a list of the valid switches:
  327. X.TP
  328. X.BI % n
  329. Word n is placed here.
  330. X.PP
  331. X.TP
  332. X.BI % n-m
  333. Word
  334. X.I n
  335. through
  336. X.I m
  337. are placed here.
  338. X.PP
  339. X.TP
  340. X.B %-
  341. All unused words are placed here.
  342. X.PP
  343. X.TP
  344. X.B %+
  345. All previously used words are placed here.
  346. X.PP
  347. X.TP
  348. X.B %%
  349. All words are placed here.
  350. X.PP
  351. X.TP
  352. X.B %#
  353. Places the number of words here. Useful for use with the single line
  354. if-then to insure the correct number of words for an alias command.
  355. X.PP
  356. X
  357. Argument zero is ignored for switches `%-', `%+', and `%%'. These switches
  358. may be embedded in a word, and since this substitution is recursive,
  359. multiple switches embedded in a word will produce every possible combination
  360. of those words. Examples:
  361. X
  362. X.br
  363. X> alias x (secho %%.%%)
  364. X.br
  365. X> x a b c  #will yield:
  366. X.br
  367. X> secho a.a a.b a.c b.a b.b b.c c.a c.b c.c
  368. X
  369. X.br
  370. X> alias user (ls ~%1-10)
  371. X.br
  372. X> user aa bb cc # will yield:
  373. X.br
  374. X> ls ~aa ~bb ~cc
  375. X
  376. If no matches are possible for the switch, then the word the switch appears
  377. in is removed from the new command line. By default, if no valid argument
  378. switches are contained in the alias, then all the words from the old command
  379. line (minus the command) are placed at the end of the resulting new command
  380. line. Alias parsing only takes place once, unlike with other shells.
  381. X
  382. X.SH VARIABLE SUBSTITUTION
  383. X
  384. Shell variables are used by the shell to maintain information about the
  385. users current environment and by the user for his own ends.
  386. X.I Ssh
  387. provides three different types of variables: string and null variables which
  388. are modified with the
  389. X.I set
  390. and
  391. X.I unset
  392. commands, and numeric variables which are modified with the
  393. X.I nset
  394. and
  395. X.I unset
  396. commands.
  397. X
  398. String variables are lists of 1 or more variable length words, while null
  399. variables contain no information, and finally, numeric variables are long
  400. integers with a single value. Null variables are usually used for true/false
  401. conditions where their existence, or lack thereof, signifies their value.
  402. X
  403. After alias parsing, variable parsing is performed.  Like the switches in
  404. aliases, variables are prefixed with the `$' or `$$' for environment
  405. variables, to signify that the value of the variable being named is to be
  406. substituted here.  This substitution is recursive and variables embedded in
  407. words produce every possible combination. Example:
  408. X
  409. X.br
  410. X> set var = aa bb cc
  411. X.br
  412. X> ls ~$var    # will yield:
  413. X.br
  414. X> ls ~aa ~bb ~cc
  415. X
  416. Individual words in a string variable may be substituted by placing an
  417. expression in `[' and `]' following the name of the variable. For example:
  418. X
  419. X.br
  420. X> set var = aa bb cc
  421. X.br
  422. X> ls ~$var[1]    # will yield:
  423. X.br
  424. X> ls ~bb
  425. X
  426. Variable names may be enclosed in `{' and `}' to separate them from other
  427. letters so that they may be embedded in a word. Example:
  428. X.br
  429. X
  430. X    /usr/tmp/${file}ext    "$${USER}XXXX"
  431. X.br
  432. X
  433. Prefixing a variable name with `$#' or `$$#' for environment variables,
  434. returns the number of words contained in a string variable or the number of
  435. letters in an individual word. Prefixing a variable with `$?' or `$$?' for
  436. environment variables, returns the type of variable or 0 if it is not
  437. defined. Environment variables are considered string variables always. The
  438. valid types are:
  439. X
  440. X.br
  441. X    0   Not defined
  442. X.br
  443. X    1   String variable
  444. X.br
  445. X    2   Numeric variable
  446. X.br
  447. X    3   Null variable
  448. X.br
  449. X
  450. The metacharacter `$<' reads in a line of text from the
  451. X.I stdin
  452. and replaces itself with the input read.
  453. X
  454. X.SH LOGICAL ASSIGNMENT SUBSTITUTION
  455. X
  456. The shell maintains a list of assignments that can be used to reference
  457. file and directory prefixes with a minimal amount of typing. Assignments
  458. are defined and undefined using the commands
  459. X.I assign
  460. and
  461. X.I unassign.
  462. Logical assignments are placed at the beginning of the word, followed by a
  463. X`:', then possibly followed by more path components or filenames. Logical
  464. assignment substitutions take place before wildcard substitution, so
  465. wildcards may be placed in the assignment to make conditional assignments.
  466. XExamples:
  467. X
  468. X.br
  469. X> assign inc "{{/usr/include,/usr/include/sys}}/"
  470. X.br
  471. X> more inc:ioctl.h        # Will yield:
  472. X.br
  473. X  more {{/usr/include,/usr/include/sys}}/ioctl.h
  474. X.br
  475. X  # To finally yield after wildcard substitution:
  476. X.br
  477. X  more /usr/include/sys/ioctl.h
  478. X
  479. Obviously files and directory paths are not the only possible use for
  480. logical assignments.  Assignment processing can be circumvented by setting
  481. the shell variable
  482. X.I noassigns.
  483. X
  484. X.SH WILDCARD SUBSTITUTION
  485. X
  486. Any word containing the characters `*', `?', `[', `{' or begins with `~'
  487. is considered a candidate for wildcard expansion, provided that the shell
  488. variable
  489. X.I noglob
  490. does not exist. The word is then parsed and the file system is examined to
  491. find files that match the pattern. If matches are found then the wildcard
  492. pattern is replaced on the command line with a sorted list of filenames
  493. that matched the pattern.  If the pattern matcher fails to find a valid
  494. match then it prints an error and the command is aborted, unless the shell
  495. variable
  496. X.I nonomatch
  497. is set, in which case it is not an error and the original pattern is left
  498. on the command line.
  499. X
  500. Hidden files (those beginning with a period `.') are also included in
  501. wildcard searches unless the
  502. X.I nodots
  503. shell variable is set, in which case they are ignored unless explicitly
  504. specified. The file system constructs `.' (current directory) and `..'
  505. X(previous directory) are always ignored for purposes of wildcard searches.
  506. X
  507. The various wildcard characters have the following meanings:
  508. X.TP
  509. X.B ~
  510. XFollowed by a user name expands to the full path of that users home
  511. directory. `~' alone expands to the shell users home directory as defined
  512. in the shell variable
  513. X.I home.
  514. X`~' followed by a wildcard expression searches the passwd file for possible
  515. user names and replaces them with the full path to their home directory.
  516. X.PP
  517. X.TP
  518. X.B *
  519. Matches zero or more characters.
  520. X.PP
  521. X.TP
  522. X.B ?
  523. Matches any single character.
  524. X.PP
  525. X.TP
  526. X.B [...]
  527. Matches to any single character that is present inside of the []'s.
  528. A `-' in between characters denotes a range of characters, where any single
  529. character in the range is matched.
  530. X.PP
  531. X.TP
  532. X.B [^...]
  533. Matches to any single character that is not present inside of the
  534. X[]'s. Just as `[...]' above.
  535. X.PP
  536. X.TP
  537. X.B {...}
  538. Comma `,', separated words are automatically expanded (macro
  539. expansion). Words inside of {}'s may be directories or more wildcard
  540. expressions.  Braces inside of the outermost level of braces becomes
  541. wildcard expansion and only matches files that exist.
  542. X.PP
  543. X.TP
  544. X.B {^...}
  545. Like `{...}', but matches anything not contained in the comma separated
  546. list. Braces inside the outermost level of braces becomes wildcard
  547. expansion like above and only match files that are not specified in the
  548. expression.
  549. X.PP
  550. X
  551. X.SH REDIRECTION
  552. X
  553. The standard input, standard output and standard error of a command may be
  554. redirected with the following syntax:
  555. X.br
  556. X.HP 5
  557. X\fB<\fP \fIname\fP
  558. X.br
  559. X.ns
  560. Open the file
  561. X.I name
  562. as the commands standard input.
  563. X.PP
  564. X.HP 5
  565. X\fB<%\fP \fIdescriptor\fP
  566. X.br
  567. X.ns
  568. Opens the file or pipe referenced by
  569. X.I descriptor
  570. as the commands standard input.  If the descriptor does not exists, a pipe
  571. is automatically made.  The read portion of a pipe is closed at the shell
  572. level.
  573. X.PP
  574. X.HP 5
  575. X\fB<<%\fP \fIdescriptor\fP
  576. X.br
  577. X.ns
  578. Opens the file or pipe referenced by
  579. X.I descriptor
  580. as above, but the read portion of a pipe is left open at the shell level.
  581. X.PP
  582. X.HP 5
  583. X\fB>\fP \fIname\fP
  584. X.br
  585. X.ns
  586. X.HP 5
  587. X\fB>!\fP \fIname\fP
  588. X.br
  589. X.ns
  590. X.HP 5
  591. X\fB>&\fP \fIname\fP
  592. X.br
  593. X.ns
  594. The commands
  595. X.I stdout
  596. X`>',
  597. X.I stderr
  598. X`>!' or both `>&' will be redirected to the named file, overwriting any
  599. data and creating the file if necessary.  If the shell variable
  600. X.I noclobber
  601. exists then the file must not exist or an error results in order to prevent
  602. the accidental destruction of files.
  603. X.PP
  604. X.HP 5
  605. X\fB>%\fP \fIdescriptor\fP
  606. X.br
  607. X.ns
  608. X.HP 5
  609. X\fB>!%\fP \fIdescriptor\fP
  610. X.br
  611. X.ns
  612. X.HP 5
  613. X\fB>&%\fP \fIdescriptor\fP
  614. X.br
  615. X.ns
  616. Opens a file or pipe referenced by
  617. X.I descriptor
  618. for output on the commands
  619. X.I stdout, stderr
  620. or both.  Like `<%' above, a pipe is created if the descriptor does not
  621. reference a pre-existing object.  The write-side of a pipe is also closed at
  622. the shell level as per `<%'.
  623. X.PP
  624. X.HP 5
  625. X\fB>>\fP \fIname\fP
  626. X.br
  627. X.ns
  628. X.HP 5
  629. X\fB>>!\fP \fIname\fP
  630. X.br
  631. X.ns
  632. X.HP 5
  633. X\fB>>&\fP \fIname\fP
  634. X.br
  635. X.ns
  636. Like `>', `>!' and `>&' above, except that the redirection appends to files
  637. rather than overwriting them. If the variable
  638. X.I noclobber
  639. exists then it is an error for the file not to exist.
  640. X.PP
  641. X.HP 5
  642. X\fB>>%\fP \fIdescriptor\fP
  643. X.br
  644. X.ns
  645. X.HP 5
  646. X\fB>>!%\fP \fIdescriptor\fP
  647. X.br
  648. X.ns
  649. X.HP 5
  650. X\fB>>&%\fP \fIdescriptor\fP
  651. X.br
  652. X.ns
  653. As `>%', `>!%' and `>&%' above, however the write-side of the pipe remains
  654. open at the shell level for further use.
  655. X.PP
  656. X.HP 5
  657. X\fIcmd\fP \fB|\fP \fIcmd2\fP
  658. X.br
  659. X.ns
  660. X.HP 5
  661. X\fIcmd\fP \fB|!\fP \fIcmd2\fP
  662. X.br
  663. X.ns
  664. X.HP 5
  665. X\fIcmd\fP \fB|&\fP \fIcmd2\fP
  666. X.br
  667. X.ns
  668. Pipes the output of the
  669. X.I stdout
  670. X`|',
  671. X.I stderr
  672. X`|!' or both `|&' of
  673. X.I cmd
  674. into the
  675. X.I stdin
  676. of
  677. X.I cmd2.
  678. X.PP
  679. X
  680. The redirection constructs `<%', `>%', etc, can be used to implement
  681. tree-like pipe structures and `reverse piping'.  Examples:
  682. X.br
  683. X
  684. X    errparse <% err > errors & cmd >!% err | cmd2
  685. X.br
  686. X.br
  687. X    cmd1 <% xx | cmd2 >% xx
  688. X.br
  689. X
  690. In the first example, the stdout of `cmd' is piped to the stdin of `cmd2'
  691. at the same time that the stderr of `cmd' is piped to the stdin of
  692. X`errparse', which is spawed in the background, so all three commands run
  693. concurrently. In the second example the two commands are made to
  694. communicate with each other via their stdin and stdout.
  695. X
  696. X
  697. X.SH EXPRESSIONS
  698. X
  699. The shell supports C like expressions that are used in some builtin
  700. commands and for indexes for string variables.  The following operators
  701. are supported:
  702. X
  703. X(   )
  704. X.br
  705. X!   ~   ++  --  +   - (unary)
  706. X.br
  707. X*   /   %
  708. X.br
  709. X+   -   <<  >>  &   ^   |
  710. X.br
  711. X<   <=  >   >=  ==  !=  !~  =~
  712. X.br
  713. X&&  ||
  714. X.br
  715. X
  716. Numbers may be expressed either as decimal, hex (with a leading 0x or 0X),
  717. octal (with a leading 0), or binary (with a leading 0b or 0B). For example:
  718. X255, 0x00FF, 0377 and 0b11111111 are all equivalent.  In ssh, all numbers
  719. are signed longword integers. `++' and `--' only operate on numeric
  720. variables.  Strings and string variables can only be compared together and
  721. only then, can two strings be compared.  A single string equates to true.
  722. The operators `=~' and `!~' compare a string (on the left side of the
  723. operator) and a pattern (on the right side of the operator) for a match or
  724. lack thereof.
  725. X
  726. A dash `-' followed by one of `defgmoprsuwxz' test the next argument, taken
  727. to be a filename, for some property of that file.  These switches have the
  728. following properties:
  729. X.TP
  730. X.B -d
  731. True if file is a directory.
  732. X.PP
  733. X.TP
  734. X.B -e
  735. True if file exists.
  736. X.PP
  737. X.TP
  738. X.B -f
  739. True if file is a regular file.
  740. X.PP
  741. X.TP
  742. X.B -g
  743. Returns the Group ID of the file.
  744. X.PP
  745. X.TP
  746. X.B -m
  747. Returns the entire mode word of the file.
  748. X.PP
  749. X.TP
  750. X.B -o
  751. True if file is owned by the user.
  752. X.PP
  753. X.TP
  754. X.B -p
  755. Returns the protection bits of the file.
  756. X.PP
  757. X.TP
  758. X.B -r
  759. True if file is readable.
  760. X.PP
  761. X.TP
  762. X.B -s
  763. Returns the size of the file in bytes.
  764. X.PP
  765. X.TP
  766. X.B -u
  767. Returns the User ID of the file owner.
  768. X.PP
  769. X.TP
  770. X.B -w
  771. True if file permits writing.
  772. X.PP
  773. X.TP
  774. X.B -x
  775. True if file is executable.
  776. X.PP
  777. X.TP
  778. X.B -z
  779. True if file is zero length.
  780. X.PP
  781. X
  782. X.SH BUILTIN COMMANDS
  783. X
  784. Builtin commands are normally executed within the context of the shell,
  785. however, if they are included in a pipeline (except as the last command in
  786. the pipeline) or placed in the background, they are then executed in a
  787. subshell. Multi-line commands like
  788. X.I for-next, repeat-until,
  789. and
  790. X.I if-then-else-endif
  791. commands are only usable in shell scripts.
  792. X.TP
  793. X\fBalias\fP [<\fIname\fP> [<\fIwordlist\fP>]]
  794. Alias with no arguments lists all the aliases, One argument, which may
  795. be a wildcard, lists all aliases that matches it. Two or more arguments
  796. makes an alias assignment.
  797. X.PP
  798. X
  799. X.TP
  800. X\fBassign\fP [<\fIname\fP> [<\fIassignment\fP>]]
  801. Assign with no arguments lists all logical assignments, One argument
  802. returns the value of that particular assignment. Two arguments makes or
  803. changes a logical assignment.
  804. X.PP
  805. X
  806. X.TP
  807. X\fBbg\fP [<\fIjob number\fP>]
  808. With no argument,
  809. X.I bg
  810. puts the first stopped job it finds into the background and starts it
  811. running. A particular job can be selected by providing bg with an argument
  812. specifying the job number.
  813. X.PP
  814. X
  815. X.TP
  816. X.B break
  817. This command is used to break out of one of the looping commands or a
  818. switch statement and continue execution at the end of the loop or switch.
  819. X.PP
  820. X
  821. X.TP
  822. X\fBcd\fP [<\fIpath\fP>]
  823. Cd without an argument changes the current working directory to the users
  824. home directory, as defined by the shell variable
  825. X.I home.
  826. Cd attempts to change dir into the argument given, failing that, it will
  827. search for the directory in the directories defined in the shell variable
  828. X.I cdpath.
  829. X.PP
  830. X
  831. X.TP
  832. X.B continue
  833. Continue skips over any remaining commands inside of a loop and continues
  834. execution of the next loop, if applicable.
  835. X.PP
  836. X
  837. X.TP
  838. X\fBdec\fP <\fIvar\fP> [<\fIvar\fP> [<\fIvar\fP> ... [<\fIvar\fP>] ... ]]
  839. decrement numeric variable by one.
  840. X.PP
  841. X
  842. X.TP
  843. X\fBelse\fP <\fIwordlist\fP>
  844. The single line
  845. X.Ielse
  846. X, when placed immediately following a single line
  847. X.I if-then
  848. command in a script file will execute the wordlist as a command, provided
  849. that the if condition was false.  This command must follow immediately the
  850. if statement and can only be used in script files.
  851. X.PP
  852. X
  853. X.TP
  854. X\fBeval\fP <\fIwordlist\fP>
  855. XEval executes the wordlist as a command in the context of the current
  856. shell.  Usefull for executing the resulting wordlist of a command string
  857. or variable.
  858. X.PP
  859. X
  860. X.TP
  861. X\fBexec\fP <\fIwordlist\fP>
  862. The specified wordlist is executed as a command in place of the current
  863. shell. Due to the nature of this command, only the rightmost command in a
  864. pipeline will be executed, as the shell will cease to exist when it is
  865. successfully executed.
  866. X.PP
  867. X
  868. X.TP
  869. X\fBexit\fP [<\fIexpression\fP>]
  870. The shell exits either with the value of 0 (without an argument) or with
  871. the value of the resulting expression.
  872. X.PP
  873. X
  874. X.TP
  875. X\fBfg\fP [<\fIjob number\fP>]
  876. Brings the first job found or the specified job into the foreground,
  877. restarting them if they were stopped.
  878. X.PP
  879. X
  880. X.HP 5
  881. X\fBfor\fP <\fIvar\fP> = <\fIexpr\fP> \fBto\fP <\fIexpr\fP> [\fBstep\fP <\fIexpr\fP>]
  882. X.br
  883. X.ns
  884. X.HP 5
  885. X  ...
  886. X.br
  887. X.ns
  888. X.HP 5
  889. X.B next
  890. X.br
  891. X.ns
  892. The variable <\fIvar\fP> is set equal to the first expression, and is
  893. incremented by the step value (default is 1), executing all the commands in
  894. between the
  895. X.I for
  896. and
  897. X.I next
  898. statements until it reaches or exceeds the resulting value of the second
  899. expression.
  900. X.PP
  901. X
  902. X.HP 5
  903. X\fBforeach\fP <\fIvar\fP> <\fIwordlist\fP>
  904. X.br
  905. X.ns
  906. X.HP 5
  907. X  ...
  908. X.br
  909. X.ns
  910. X.HP 5
  911. X.B endfor
  912. X.br
  913. X.ns
  914. The variable <\fIvar\fP> is set to each word in <\fIwordlist\fP> successively
  915. in turn, executing all the commands between the
  916. X.I foreach
  917. and
  918. X.I endfor
  919. statements for each word in <\fIwordlist\fP>.
  920. X.PP
  921. X
  922. X.TP
  923. X\fBgoto\fP [\fB-f\fP] [\fB-r\fP] [\fB-t\fP] <\fIlabel\fP>
  924. Goto searches the script file for a matching label, defined by the label
  925. command and continues execution from there.  Goto uses several options to
  926. improve its efficiency in this search.  The following switches have these
  927. meanings:
  928. X.br
  929. X.RS 5
  930. X.TP
  931. X.B -f
  932. Search forward from the current position.
  933. X.PP
  934. X.TP
  935. X.B -r
  936. Search backward from the current position.
  937. X.PP
  938. X.TP
  939. X.B -t
  940. Start search at the top of file.
  941. X.PP
  942. X.RE 5
  943. X.PP
  944. X
  945. X.TP
  946. X\fBhistory\fP [\fB-r\fP] [\fB-n\fP] [\fI-nn\fP]
  947. Displays a list of the saved command history. It supports the following
  948. switches:
  949. X.br
  950. X.RS 5
  951. X.TP
  952. X.B -r
  953. Display history list in reverse order.
  954. X.PP
  955. X.TP
  956. X.B -n
  957. Do not number output of history list.
  958. X.PP
  959. X.TP
  960. X.I -nn
  961. Display only
  962. X.I nn
  963. histories.
  964. X.PP
  965. X.RE 5
  966. X.PP
  967. X
  968. X.TP
  969. X\fBif\fP <\fIexpression\fP> \fBthen\fP <\fIcommand\fP>
  970. If the expression evaluates to true (non-zero), then the statement is
  971. executed.  To implement pipelines and complex commands and redirection, the
  972. command should be enclosed in ()'s to insure that parsing is not done on
  973. command until it is to be executed.  This command may be immediately
  974. followed by a single line \fIelse\fP if executed in the context of a script.
  975. X.PP
  976. X
  977. X.HP 5
  978. X\fBif\fP <\fIexpression\fP> \fBthen\fP
  979. X.br
  980. X.ns
  981. X.HP 5
  982. X  ...
  983. X.br
  984. X.ns
  985. X.HP 5
  986. X.B else
  987. X.br
  988. X.ns
  989. X.HP 5
  990. X  ...
  991. X.br
  992. X.ns
  993. X.HP 5
  994. X.B endif
  995. X.br
  996. X.ns
  997. Like the single line if, the multi-line if, executes all the commands in
  998. between the
  999. X.I if-then
  1000. and
  1001. X.I else
  1002. or
  1003. X.I endif
  1004. statements if the expression evaluates to true. If the expression evaluates
  1005. to false and an else statement exists, then the commands in between the
  1006. X.I else
  1007. and
  1008. X.I endif
  1009. statements are executed.
  1010. X.PP
  1011. X
  1012. X.TP
  1013. X\fBinc\fP <\fIvar\fP> [<\fIvar\fP> [<\fIvar\fP> ... [<\fIvar\fP>] ... ]]
  1014. Increment the given numeric variable(s) by one.
  1015. X.PP
  1016. X
  1017. X.TP
  1018. X\fBinput\fP [\fB-c\fP] [\fB-e\fP] [\fB-w\fP] [\fB-n\fP] [\fB-p\fP] <\fIvar\fP>
  1019. Inputs a line or character from the
  1020. X.I stdin.
  1021. The way input reads in the data is modified by these switches:
  1022. X.br
  1023. X.RS 5
  1024. X.TP
  1025. X.B -c
  1026. Reads a single character from the
  1027. X.I stdin
  1028. and then places the character in the variable immediately, without echoing
  1029. the character to the screen.
  1030. X.PP
  1031. X.TP
  1032. X.B -e
  1033. Like `-c', except the character read is echoed to the screen.
  1034. X.PP
  1035. X.TP
  1036. X.B -w
  1037. Splits the input line into words separated by spaces and tabs.
  1038. X.PP
  1039. X.TP
  1040. X.B -n
  1041. Does not overwrite or create the variable if nothing was typed in (ignored
  1042. for `-c' and `-e').
  1043. X.PP
  1044. X.TP
  1045. X.B -p
  1046. The next word is taken to be the prompt string, which will be printed before
  1047. input is taken.
  1048. X.PP
  1049. X.RE 5
  1050. X.PP
  1051. X
  1052. X.TP
  1053. X\fBintr\fP [+] [-] <\fIsignal list\fP>
  1054. X.I Intr
  1055. is used in script files to set which termination signals that the shell
  1056. will abort scripting on.  By default the SIGPIPE signal is ignored.
  1057. X.I Intr
  1058. with no arguments lists all the termination signals that the shell acts on.
  1059. The `-' option removes all signals from the list, and the `+' option adds
  1060. all signals to the list. <\fISignal list\fP> is a list of valid signal names
  1061. that toggle the signal on or off.  Valid signal names are:
  1062. X
  1063. HUP INT QUIT ILL TRAP IOT EMT FPE KILL BUS SEGV SYS PIPE ALRM TERM URG STOP
  1064. TSTP CONT CHLD TTIN TTOU IO XCPU XFSZ VTALRM PROF WINCH USR1 USR2
  1065. X.PP
  1066. X
  1067. X.HP 5
  1068. X.B jobs
  1069. X.br
  1070. X.ns
  1071. Prints the number, process ID, status and job name of the all jobs that the
  1072. shell is tracking.
  1073. X.PP
  1074. X
  1075. X.TP
  1076. X\fBkey\fP [\fB-r\fP] [\fB-c\fP] [\fB-f\fIn\fP] [\fB-g\fIn\fP] [\fB-l\fIn\fP] [<\fIkeylist\fP> [<\fIwordlist\fP>]]
  1077. X.I Key
  1078. allows the user to setup and maintain multi-level key macros and assign
  1079. editing functions to specific key sequences. It supports these switches:
  1080. X.br
  1081. X.RS 5
  1082. X.TP
  1083. X.B \-r
  1084. XExecutes the key macro as a command immediately.
  1085. X.PP
  1086. X.TP
  1087. X.B \-c
  1088. Clears the line before inserting the key macro.
  1089. X.PP
  1090. X.TP
  1091. X.BI \-f n
  1092. Assign key sequence to edit function
  1093. X.I n.
  1094. Valid edit functions are:
  1095. X.br
  1096. X 0   No function.
  1097. X.br
  1098. X 1   Previous history.
  1099. X.br
  1100. X 2   Next history.
  1101. X.br
  1102. X 3   Move left.
  1103. X.br
  1104. X 4   Move right.
  1105. X.br
  1106. X 5   Delete previous character.
  1107. X.br
  1108. X 6   Toggle insert/overstrike.
  1109. X.br
  1110. X 7   Move to start of line.
  1111. X.br
  1112. X 8   Delete to the right.
  1113. X.br
  1114. X 9   Move to the end of line.
  1115. X.br
  1116. X10   Kill to end of line.
  1117. X.br
  1118. X11   Restore line.
  1119. X.br
  1120. X12   Kill line.
  1121. X.br
  1122. X13   Quoted insert.
  1123. X.br
  1124. X14   Find matching history.
  1125. X.br
  1126. X15   Kill to start of line.
  1127. X.br
  1128. X16   Filename completion.
  1129. X.br
  1130. X17   Forward word.
  1131. X.br
  1132. X18   Backward word.
  1133. X.br
  1134. X19   Parse line and replace.
  1135. X.br
  1136. X20   Kill word.
  1137. X.br
  1138. X21   Make next character a control character.
  1139. X.PP
  1140. X.TP
  1141. X.BI \-g n
  1142. Defines a gold key that makes the current keypad level equal to
  1143. X.I n
  1144. when the key sequence is entered.  There are a maximum of 10 keypad levels
  1145. X(0-9).
  1146. X.PP
  1147. X.TP
  1148. X.BI \-l n
  1149. Keypad level that this macro is being defined for.  Keypad level 0 is the
  1150. default.
  1151. X.PP
  1152. X.RE 5
  1153. X.PP
  1154. X
  1155. X.TP
  1156. X\fBlabel\fP <\fIlablename\fP>
  1157. Defines a label for use with the goto command.
  1158. X.PP
  1159. X
  1160. X.TP
  1161. X\fBlimit\fP [<\fIresource\fP> [<\fIresource limit\fP>]]
  1162. Without arguments,
  1163. X.I limit
  1164. displays the current resource limits for
  1165. X.I cpu, filesize, datasize, stacksize, coredumpsize
  1166. and
  1167. X.I memoryuse,
  1168. specified in K (1024) bytes or seconds for cpu usage, or
  1169. X.I unlimited
  1170. for unlimited resources in that area.
  1171. With one argument, limit displays the current limit for that resource.
  1172. With two arguments, limit sets the limit for that resource.
  1173. X.PP
  1174. X
  1175. X.TP
  1176. X.B login
  1177. Starts a new session by replacing the shell with the system login command.
  1178. X.PP
  1179. X
  1180. X.TP
  1181. X\fBlogout\fP [<\fIwordlist\fP>]
  1182. If the shell is a login shell, then logout saves the history to the
  1183. X.I .hist
  1184. file in the users home directory, then sources the users
  1185. X.I .logout
  1186. file located in their home directory, passing the wordlist in the shell
  1187. variable
  1188. X.I argv
  1189. to the script and then exits. If the shell is not a login shell, the shell
  1190. simply exits.
  1191. X.PP
  1192. X
  1193. X.TP
  1194. X\fBprotect\fP <\fIvar\fP>
  1195. Makes the variable ``protected'', in that it cannot be reset or unset.
  1196. X.PP
  1197. X
  1198. X.HP 5
  1199. X.B repeat
  1200. X.br
  1201. X.ns
  1202. X.HP 5
  1203. X  ...
  1204. X.br
  1205. X.ns
  1206. X.HP 5
  1207. X\fBuntil\fP <\fIexpression\fP>
  1208. X.br
  1209. X.ns
  1210. XExecutes commands inside of the
  1211. X.I repeat
  1212. and
  1213. X.I until
  1214. commands until the <\fIexpression\fP> evaluates to true.
  1215. X.PP
  1216. X
  1217. X.TP
  1218. X\fBsclose\fP <\fIdescriptor\fP> [<\fIdescriptor\fP> ... <\fIdescriptor\fP>]
  1219. Closes open files or pipes referenced by <\fIdescriptor\fP>.
  1220. X.PP
  1221. X
  1222. X.TP
  1223. X\fBsecho\fP [\fB-n\fP] [\fB-w\fP] [\fB-e\fP] [\fB-\fP] [<\fIwordlist\fP>]
  1224. X.I Secho
  1225. is the shells version of the
  1226. X.I echo
  1227. command, with the wordlist being routed through the shells stat
  1228. facility to convert certain `%' switches (see STATUS SWITCHES below),
  1229. unless the `-e' switch is given.
  1230. These switches to
  1231. X.I secho
  1232. are supported:
  1233. X.br
  1234. X.RS 5
  1235. X.TP
  1236. X.B -n
  1237. Do not print a newline at the end of the wordlist.
  1238. X.PP
  1239. X.TP
  1240. X.B -w
  1241. Toggles printing of a newline after each word.
  1242. X.PP
  1243. X.TP
  1244. X.B -e
  1245. Toggles interpretation of status switches off and on.
  1246. X.PP
  1247. X.TP
  1248. X.B -x
  1249. XEverything after this switch is taken to be an expression to be evaluated
  1250. and the result printed.
  1251. X.PP
  1252. X.TP
  1253. X.B -
  1254. All dash arguments after this are taken to be words to be printed. No
  1255. further arguments are parsed.
  1256. X.PP
  1257. X.RE 5
  1258. X.PP
  1259. X
  1260. X.HP 5
  1261. X\fBset\fP [<\fIvar\fP> [< = | += > <\fIwordlist\fP>]]
  1262. X.br
  1263. X.ns
  1264. X.HP 5
  1265. X\fBnset\fP [<\fIvar\fP> [<\fIoperator\fP> [<\fIexpression\fP>]]]
  1266. X.br
  1267. X.ns
  1268. X.I Set
  1269. or
  1270. X.I nset
  1271. list the value of all known variables when used with no arguments. With
  1272. only one argument they creates a null variable of name <\fIvar\fP>.
  1273. X.I Set
  1274. when used with a `=', sets the variable equal to the wordlist. When used
  1275. with `+=' set appends the wordlist to the wordlist in <\fIvar\fP> (useful
  1276. for quickly adding directories to the
  1277. X.I path
  1278. variable).
  1279. X.I Nset
  1280. is used to create and modify numeric variables and 
  1281. supports the following numeric assignment operators: `=', `+=', `-=',
  1282. X`*=', `/=', `|=', `^=', `<<=' and `>>='.  The operators `++' and `--' can
  1283. be used to increment or decrement the variable by one.
  1284. X.PP
  1285. X
  1286. X.TP
  1287. X\fBsetenv\fP <\fIname\fP> [[=] <\fIwordlist\fP>]
  1288. X.I Setenv
  1289. displays and sets environment variables for the shell.  With one argument,
  1290. setenv displays the value of the environment variable <\fIname\fP>. With two or
  1291. more arguments,
  1292. X.I setenv
  1293. assigns the <\fIwordlist\fP> to the variable <\fIname\fP>.  The equal sign
  1294. X`=' is optional for setenv.
  1295. X.PP
  1296. X
  1297. X.TP
  1298. X\fBshift\fP <\fIshiftval\fP> <\fIvar\fP> [<\fIvar\fP> ... [<\fIvar\fP>]]
  1299. X.I Shift
  1300. shifts words left in <\fIvar\fP>, <\fIshiftval\fP> number of times.  This is
  1301. useful for removing the beginning words in the shell variable
  1302. X.I argv
  1303. so that it may be fed to a
  1304. X.I foreach
  1305. command to parse the arguments fed to the script.
  1306. X.PP
  1307. X
  1308. X.TP
  1309. X\fBsopen\fP [<\fIdescriptor\fP> [<\fIfile\fP> <\fImodelist\fP>]]
  1310. With no arguments,
  1311. X.I sopen
  1312. lists all open files and pipes and their modes.  Provided the descriptor,
  1313. X.I sopen
  1314. lists the file or pipe it references and modes for that descriptor.
  1315. X.I Sopen
  1316. with three or more arguments opens a file or pipe and associated with a
  1317. logical descriptor name <\fIdescriptor\fP> which is used in the
  1318. X.I sread, swrite, sseek
  1319. and
  1320. X.I sclose
  1321. calls and the `<%' `<<%' ,`>%', etc redirections to reference the open file
  1322. or pipe.
  1323. X.I Mode
  1324. is one of the following, defining how the file is to be opened:
  1325. X.br
  1326. X    READ       Open for reading
  1327. X.br
  1328. X    WRITE      Open for writing
  1329. X.br
  1330. X    APPEND     Append to end of file.
  1331. X.br
  1332. X    TRUNCATE   Truncate file upon open.
  1333. X.br
  1334. X    PIPE       Open a pipe for reading and writing
  1335. X.br
  1336. A file may be open for reading and writing at the same time.  When a PIPE
  1337. descriptor is made, the pipe is made to be read and writeable until the
  1338. first sread or swrite is performed on the pipe, at which time the mode of the
  1339. pipe is selected (this is done to allow the user to launch any pipe
  1340. redirections before reading/writing on the pipe).
  1341. X.PP
  1342. X
  1343. X.TP
  1344. X\fBsource\fP [<\fIfile\fP> [<\fIfile\fP> ... [<\fIfile\fP>] ... ]]
  1345. X.I Source
  1346. with no file arguments, reads input from the user, up until it reaches the
  1347. X`exit' command and then sources the input.  With file arguments,
  1348. X.I source
  1349. sources each file in turn.  Files sourced in this way are executed in the
  1350. context of the shell, so changes made to the shell environment are permanent.
  1351. X.PP
  1352. X
  1353. X.TP
  1354. X\fBsread\fP <\fIdescriptor\fP> [\fB-c\fP] [\fB-l\fP] [\fB-w\fP] [\fB-b\fIn\fP] <\fIvarlist\fP>
  1355. X.I Sread
  1356. reads input from a file or pipe referenced by the logical file descriptor
  1357. X<descriptor> into a variable.  Switches may be interspersed on the command
  1358. line to change how the data is read for each variable.  Valid switches are:
  1359. X.br
  1360. X.RS 5
  1361. X.TP
  1362. X.B -c
  1363. Read a single character.
  1364. X.PP
  1365. X.TP
  1366. X.B -l
  1367. Read in a line and do no processing on it.
  1368. X.PP
  1369. X.TP
  1370. X.B -w
  1371. Read in a line and break it into words separated at spaces and tabs.
  1372. Useful for separating input into fields which can be easily manipulated.
  1373. X.PP
  1374. X.TP
  1375. X.BI \-b n
  1376. Read in
  1377. X.I n
  1378. bytes.
  1379. X.PP
  1380. A read past end of file returns an error and sets the shell variable
  1381. X.I EOF
  1382. with the name of the offending descriptor.
  1383. X.RE 5
  1384. X.PP
  1385. X
  1386. X.TP
  1387. X\fBsseek\fP <\fIdescriptor\fP> <\fImode\fP> <\fIexpression\fP>
  1388. X.I Sseek
  1389. sets the file pointer for the file referenced by <\fIdescriptor\fP> based
  1390. upon the mode.  Valid modes are:
  1391. X.br
  1392. X    INCR   Increment the file pointer.
  1393. X.br
  1394. X    SET    Set the file pointer.
  1395. X.br
  1396. X    XTND   Extend the file pointer past the
  1397. X.I EOF.
  1398. X.br
  1399. X<\fIExpression\fP> is the resulting value used to change the file pointer with.
  1400. Upon a successful seek, the shell variable
  1401. X.I filepos
  1402. is updated to reflect the current file pointer value.  Sseek's cannot be
  1403. performed on descriptors referencing a pipe.
  1404. X.PP
  1405. X
  1406. X.TP
  1407. X\fBstop\fP [<\fIjob number\fP>]
  1408. Stops the first running background process found in the job queue, or stops
  1409. the specified job by sending the jobs the SIGTSTP signal.
  1410. X.PP
  1411. X
  1412. X.HP 5
  1413. X\fBswitch\fP <\fIstring\fP>
  1414. X.br
  1415. X.ns
  1416. X.HP 5
  1417. X  \fBcase\fP <\fIpattern list\fP>
  1418. X.br
  1419. X.ns
  1420. X.HP 5
  1421. X    ...
  1422. X.br
  1423. X.ns
  1424. X.HP 5
  1425. X    \fBbreak\fP
  1426. X.br
  1427. X.ns
  1428. X.HP 5
  1429. X  ...
  1430. X.br
  1431. X.ns
  1432. X.HP 5
  1433. X  \fBdefault\fP
  1434. X.br
  1435. X.ns
  1436. X.HP 5
  1437. X    ...
  1438. X.br
  1439. X.ns
  1440. X.HP 5
  1441. X    \fBbreak\fP
  1442. X.br
  1443. X.ns
  1444. X.HP 5
  1445. X.B endsw
  1446. X.br
  1447. X.ns
  1448. X.I Switch
  1449. compares string against each case label, that is variable expanded and may
  1450. be a filename wildcard expression, until it finds a match.  If it finds a
  1451. match, then it begins executing lines after the case until it reaches a
  1452. break statement or endsw, falling through other case statements.  If no
  1453. match is found and there exists the
  1454. X.I default
  1455. label, then commands are executed after the default label.  If no match was
  1456. found and no default label exists, then the switch is aborted and execution
  1457. continues after the endsw command.
  1458. X.PP
  1459. X
  1460. X.TP
  1461. X\fBswrite\fP <\fIdescriptor\fP> [\fB-n\fP] <\fIwordlist\fP>
  1462. X.I Swrite
  1463. writes the specified wordlist to the file or pipe referenced by
  1464. X<\fIdescriptor\fP>, which may contain the shells status switches (see
  1465. STATUS SWITCHES below).
  1466. X.PP
  1467. X
  1468. X.TP
  1469. X\fBterm\fP [<\fIcapability ID\fP> [<\fIcharacter sequence\fP>]]
  1470. X.I Term
  1471. prints the current terminal that the shell is using and several of the
  1472. escape sequences that the terminal understands that the shell will use.  The
  1473. values of these sequences may be shown by specifying one of the valid
  1474. terminal capabilities.  A terminal capability may be altered by specifying an
  1475. additional character sequence after the capability ID.  The following
  1476. capabilities are used by the shell:
  1477. X.br
  1478. X    SO    Begin standout mode.
  1479. X.br
  1480. X    SE    End standout mode.
  1481. X.br
  1482. X    CE    Clear to end of line.
  1483. X.br
  1484. X    KS    Function keypad enable.
  1485. X.br
  1486. X    KE    Function keypad disable.
  1487. X.br
  1488. X    DC    Delete character.
  1489. X.br
  1490. X    IC    Insert character.
  1491. X.br
  1492. X    DS    Display status line.
  1493. X.br
  1494. X    TC    Begin writing on status line.
  1495. X.br
  1496. X    FS    End writing on status line.
  1497. X.br
  1498. X    HS    Has status line (1=TRUE).
  1499. X.br
  1500. The shell is intelligent enough to work without almost all of the above
  1501. terminal capabilities, but CE is recommended. DC and IC may greatly improve
  1502. speed of editing for slower baud rates as well.  Unsetting DC and IC for
  1503. slow-editing terminals at higher baud rates may also improve editing speed.
  1504. X.PP
  1505. X
  1506. X.TP
  1507. X\fBumask\fP [<\fIexpression\fP>]
  1508. X.I Umask
  1509. with no arguments returns the current file protection mask in octal,
  1510. otherwise
  1511. X.I umask
  1512. sets the value of the file protection mask to the value of the resulting
  1513. expression.
  1514. X.PP
  1515. X
  1516. X.TP
  1517. X\fBunalias\fP <\fIpatternlist\fP>
  1518. Removes all aliases that match the given wildcard patterns.
  1519. X.PP
  1520. X
  1521. X.TP
  1522. X\fBunassign\fP <\fIassignmentlist\fP>
  1523. Removes the given assignments from the list of known assignments.
  1524. X.PP
  1525. X
  1526. X.TP
  1527. X\fBunkey\fP [\fB-l\fIn\fB] <\fIkey sequence\fP>
  1528. Removes the key macro associated with the given key sequence. The switch
  1529. X.BI \-l n
  1530. specifies the keypad level the macro is to be removed from.
  1531. X.PP
  1532. X
  1533. X.TP
  1534. X\fBunlimit\fP <\fIresource\fP>
  1535. This command attempts to remove the system imposed limits on the specified
  1536. resource, if possible.  Valid resources are the same as those given with
  1537. the limit command:
  1538. X.I cpu, filesize, datasize, stacksize, coredumpsize
  1539. and
  1540. X.I memoryuse.
  1541. X.PP
  1542. X
  1543. X.TP
  1544. X\fBunset\fP <\fIvariable\fP>
  1545. Removes the named variable from the list of known variables.
  1546. X.PP
  1547. X
  1548. X.TP
  1549. X\fBunsetenv\fP <\fIvariable\fP>
  1550. Removes the named variable from the environment.
  1551. X.PP
  1552. X
  1553. X.TP
  1554. X.B usage
  1555. Displays some information about the system resource usage of the shell,
  1556. including: Total user and system time used by the shell, the resident set
  1557. size (RSS) of the shell, total page reclaims and faults, number of times
  1558. the shell has been swapped, number of I/O pages read and written and the
  1559. number of signals received. The amount of valid information maintained and
  1560. the true meaning of the above information may vary from OS to OS.
  1561. X.PP
  1562. X
  1563. X.TP
  1564. X.B version
  1565. Displays the shells version information.
  1566. X.PP
  1567. X
  1568. X.HP 5
  1569. X\fBwhile\fP <\fIexpression\fP>
  1570. X.br
  1571. X.ns
  1572. X.HP 5
  1573. X  ...
  1574. X.br
  1575. X.ns
  1576. X.HP 5
  1577. X.B wend
  1578. X.br
  1579. X.ns
  1580. XExecutes commands inside of the
  1581. X.I while - wend
  1582. loop so long as the expression evaluates to true.
  1583. X.PP
  1584. X
  1585. X.SH SHELL VARIABLES
  1586. X
  1587. Certain variables have special meaning to the shell.  The variables
  1588. X.I cwd, failat, history, home, host, insert, path, pid, prompt,
  1589. X.I status, term, tty,
  1590. and
  1591. X.I user
  1592. are always set upon login. The variables
  1593. X.I echo, remotehost
  1594. and
  1595. X.I verbose
  1596. might also be set at login. Aside from the variables
  1597. X.I cwd
  1598. and
  1599. X.I status
  1600. which are updated by the shell automatically, these variables are only set
  1601. once at login.
  1602. X
  1603. XFor the variables user, term and path, the shell attempts to use the
  1604. environment if possible to set these values initially.  Variables like term
  1605. and path, are likewise automatically exported to the environment any time
  1606. they are changed by the user.
  1607. X
  1608. The following variables have special meaning to the shell:
  1609. X.TP 15
  1610. X.B argc
  1611. Defined to be equal to the number of words in
  1612. X.I argv,
  1613. therefore it is
  1614. essentially the same as `$#argv'.  Only defined when
  1615. X.I argv
  1616. is defined.
  1617. X.PP
  1618. X.TP 15
  1619. X.B argv
  1620. Set to the arguments passed to an auto-executed shell script, including the
  1621. command itself in `$argv[0]'.
  1622. X.PP
  1623. X.TP 15
  1624. X.B cdpath
  1625. Directories specified in this string variable are searched in the event of
  1626. a failed `cd' to find a valid subdirectory.
  1627. X.PP
  1628. X.TP 15
  1629. X.B cwd
  1630. This variable is maintained by the shell to be reflect the current working
  1631. directory at all times. This variable is automatically exported to the
  1632. environment.
  1633. X.PP
  1634. X.TP 15
  1635. X.B echo
  1636. Set when the -x or -X command line option is given.  Causes the shell to
  1637. echo the entire command line before each command is executed.  Useful for
  1638. debugging shell scripts.
  1639. X.PP
  1640. X.TP 15
  1641. X.B EOF
  1642. This string variable is set by the command
  1643. X.I sread
  1644. when it reads the end of
  1645. file.  The resulting string is equal to the name of the file descriptor.
  1646. X.PP
  1647. X.TP 15
  1648. X.B failat
  1649. The value of this numeric variable is used in script files when a command
  1650. returns an error condition (greater than 0).  The value of
  1651. X.I failat
  1652. is checked against the return status of the command, and if it is lower or
  1653. equal to the status, then the script file is aborted.
  1654. X.PP
  1655. X.TP 15
  1656. X.B filepos
  1657. This numeric variable contains the current file pointer position as returned
  1658. by the last successful
  1659. X.I sseek
  1660. command.
  1661. X.TP 15
  1662. X.B history
  1663. This numeric variable determines the number of histories maintained by the
  1664. shell.  By default this variable is set to 30 histories by the shell, and
  1665. is also set automatically by the shell when it reads the first line in the
  1666. X.I .hist
  1667. file in the users home directory, which should contain the number of
  1668. histories to save.  The history list will never be less than one entry,
  1669. even if the variable is unset.
  1670. X.PP
  1671. X.TP 15
  1672. X.B home
  1673. Set to the home directory of the user. Used by
  1674. X.I cd
  1675. to return to the users home directory, when no arguments are given it,
  1676. and by the wildcard character `~'. This variable is exported to the
  1677. environment automatically.
  1678. X.PP
  1679. X.TP 15
  1680. X.B homedirs
  1681. This string variable contains a list of user directories for use with the
  1682. X`%~' status switch.
  1683. X.PP
  1684. X.TP 15
  1685. X.B insert
  1686. Used by the input functions to determine if the user is in insert mode or
  1687. overstrike mode.  Insert mode is selected if the variable exists.
  1688. X.PP
  1689. X.TP 15
  1690. X.B mail
  1691. This string variable contains a list of files that are checked after each
  1692. command completion and if the interval specified by the variable
  1693. X.I mailchkint
  1694. has elapsed, to see if they contain new mail.  If new mail is found, then
  1695. the shell reports to the user `You have new mail.' If the mail file is not
  1696. the first entry in the
  1697. X.I mail
  1698. variable, then the filename with the new mail is also reported.  This
  1699. message may be modified by setting the
  1700. X.I mailnotice
  1701. variable. This variable is exported to the environment automatically.
  1702. X.PP
  1703. X.TP 15
  1704. X.B mailchkint
  1705. This numeric variable defines the minimum interval that new mail is to be
  1706. checked for.
  1707. X.PP
  1708. X.TP 15
  1709. X.B mailnotice
  1710. The first word of this string variable defines the message the shell prints
  1711. in the event of new mail.  The second word, if present defines what to
  1712. print for the status switch `%n'.
  1713. X.PP
  1714. X.TP 15
  1715. X.B noassigns
  1716. If this variable exists, then logical assignment processing is not performed
  1717. by the shell.
  1718. X.PP
  1719. X.TP 15
  1720. X.B nobgnull
  1721. If this variable exists, the shell will not redirect to
  1722. X.I /dev/null
  1723. by default for jobs spawned in the background.
  1724. X.PP
  1725. X.TP 15
  1726. X.B noclobber
  1727. If this variable exists, then it is an error for the user to attempt to
  1728. redirect into a file that already exists, or perform appended redirection
  1729. into a file that does not already exist.
  1730. X.PP
  1731. X.TP 15
  1732. X.B nodots
  1733. When this variable exists, files preceded by a dot `.', therefore
  1734. hidden files, will not be considered candidates for pattern matching,
  1735. unless the dot is explicitly given in the expression.
  1736. X.PP
  1737. X.TP 15
  1738. X.B noglob
  1739. If this variable exists, then wildcard expansion is not performed by the
  1740. shell.
  1741. X.PP
  1742. X.TP 15
  1743. X.B nohup
  1744. If this variable exists, then jobs executed in the background are made to
  1745. ignore the SIGHUP signal.
  1746. X.PP
  1747. X.TP 15
  1748. X.B nonomatch
  1749. When this variable exists, then it is not an error for a wildcard
  1750. expression to not match any files and is not removed from the command line.
  1751. X.PP
  1752. X.TP 15
  1753. X.B notypeahead
  1754. When this variable exists, then the shell throws away any pending input
  1755. X(typeahead), before it prints the prompt and begins accepting input for the
  1756. command line.
  1757. X.PP
  1758. X.TP 15
  1759. X.B path
  1760. This string variable contains a list of directories in which the shell
  1761. searches for commands to be executed by the user.  If no path variable
  1762. exists, then the path is considered to be the current directory only.
  1763. This variable is exported to the environment automatically.
  1764. X.PP
  1765. X.TP 15
  1766. X.B prompt
  1767. This string variable is printed before each command is read. This variable
  1768. may contain status switches as well. Only the first 80 characters of this
  1769. variable (after status switches are interpreted) are used.
  1770. X.PP
  1771. X.TP 15
  1772. remotehost
  1773. Set to the remote login host as specified in the /etc/utmp file for your
  1774. login session if you are logged in remotely.
  1775. X.PP
  1776. X.TP 15
  1777. X.B statline
  1778. This string is printed in the status line after every command completion if
  1779. it is possible to do so, i.e. the terminal must support a status line.
  1780. Like the prompt variable, the statline may contain any of the status
  1781. switches.
  1782. X.PP
  1783. X.TP 15
  1784. X.B status
  1785. This numeric variable is maintained by the shell, and may not be altered or
  1786. unset by the user.  This variable contains the exit status of the last
  1787. command to complete (including completed background jobs). The lower 8
  1788. order bits are formed by the exit status of the command, the next 8 order
  1789. bits are formed from the value of the killing signal (if any). To determine
  1790. if the command exited abnormally you would use an if statement similar to:
  1791. X.br
  1792. X
  1793. X     if ($status>>8) then ...
  1794. X.br
  1795. X
  1796. To separate the status information:
  1797. X.br
  1798. X
  1799. X     nset exitval = $status
  1800. X.br
  1801. X     nset signal = ($exitval>>8)
  1802. X.br
  1803. X     nset exitval &= 255
  1804. X.br
  1805. X
  1806. Shell builtins return a `1' upon failure, otherwise they return a `0'.
  1807. X.PP
  1808. X.TP 15
  1809. X.B term
  1810. This string variable is used to set the terminal type of the current login
  1811. session. The terminal capabilities used by the shell (as displayed by the
  1812. X.I term
  1813. command) are automatically loaded whenever this variable is changed.  This
  1814. variable is automatically exported to the environment whenever it is
  1815. altered.
  1816. X.PP
  1817. X.TP 15
  1818. X.B timeout
  1819. When this numeric variable is set, the shell will logout automatically
  1820. after the number of seconds defined by the variable has elapsed and no
  1821. input has been entered by the user. This count-down only happens when the
  1822. user is at the shell prompt and idle.
  1823. X.PP
  1824. X.TP 15
  1825. X.B verbose
  1826. Set by the -v and -V command line options.  When this variable exists, the
  1827. command line is printed before any parsing is done on the command line.
  1828. X.PP
  1829. X
  1830. X.SH NON-BUILTIN COMMAND EXECUTION
  1831. X
  1832. When a command to be executed is determined to not be a builtin command, the
  1833. shell searches the path list defined in the
  1834. X.I path
  1835. shell variable for the requested command.  If the command is found then the
  1836. shell checks to see if the command is actually a directory, if so then it
  1837. attempts to make it the current working directory.  Otherwise the shell
  1838. forks and attempts to execute the command.
  1839. X
  1840. If the command was spawed to be a background process with the `&!'
  1841. metacharacter, then the shell closes stdin, stdout, and stderr (input and
  1842. output redirections will not be affected by this), forks several more times
  1843. and attempts to dissociate the terminal.  Due to the extra forking
  1844. involved in the terminal dissociation process, the shell will lose track
  1845. of the child process.
  1846. X
  1847. Immediately after forking, the shell determines if the job was a process
  1848. leader.  Process leaders are the right most commands in pipelines.
  1849. Processes not in pipelines are also process leaders.  If a job has been
  1850. determined to be a process leader and the job was not spawned as a
  1851. background job, then the shell relinquishes control of the terminal, adds
  1852. an entry in the shell job table and waits for the job to complete.  The
  1853. process is nearly identical for non-process leaders, however non-process
  1854. leaders inherit the same control terminal as the process leader.
  1855. X
  1856. Should the process leader complete before any of the non-leaders, then the
  1857. remaining processes are certain losers as the shell will regain control of
  1858. the terminal when the process leader completes.  Since most non-leaders in
  1859. pipes would be killed by the broken pipe or by other means, this is not
  1860. really a problem.
  1861. X
  1862. If the shell fails in its effort to exec the command, and it is determined
  1863. that it failed because the file that it was attempting to execute was not a
  1864. binary file or a script file which specified its shell in the first line,
  1865. then it will attempt to auto-source the file.  Files auto-sourced in this
  1866. manner, have the arguments passed to them in the shell variables
  1867. X.I argv
  1868. and
  1869. X.I argc.
  1870. XFiles sourced in this manner are executed in a subshell and will not affect
  1871. the environment of the parent shell.
  1872. X
  1873. XFiles that are sourced or auto-sourced, are read entirely into a buffer and
  1874. parsed before they are executed.  Command strings are also parsed and
  1875. executed at this time.  The resulting buffer is then sourced, performing
  1876. the neccessary variable, logical assignment and wildcard expansion at each
  1877. line.
  1878. X
  1879. X.SH STATUS SWITCHES
  1880. X
  1881. The following switches may be embedded in the words of the
  1882. X.I prompt
  1883. and
  1884. X.I statline
  1885. variables and passed to the
  1886. X.I secho
  1887. command for printing.  Their meanings are:
  1888. X.br
  1889. X.TP
  1890. X.B %t
  1891. Replaced by the time in hh:mm [am|pm] format.
  1892. X.PP
  1893. X.TP
  1894. X.B %M
  1895. Replaced by the time in hh:mm military format.
  1896. X.PP
  1897. X.TP
  1898. X.B %w
  1899. Replaced by the name of the day of the week.
  1900. X.PP
  1901. X.TP
  1902. X.B %d
  1903. Replaced by the day of the month.
  1904. X.PP
  1905. X.TP
  1906. X.B %m
  1907. Replaced by the name of the month.
  1908. X.PP
  1909. X.TP
  1910. X.B %y
  1911. Replaced by the year.
  1912. X.PP
  1913. X.TP
  1914. X.B %T
  1915. Replaced by the time the user has been logged in, in hh:mm format.
  1916. X.PP
  1917. X.TP
  1918. X.B %j
  1919. Replaced by the number of jobs the shell has active.
  1920. X.PP
  1921. X.TP
  1922. X.B %p
  1923. Replaced by the path of the current working directory.
  1924. X.PP
  1925. X.TP
  1926. X.B %P
  1927. Replaced by the last path component in the current working directory.
  1928. X.PP
  1929. X.TP
  1930. X.B %~
  1931. Replaced with the path, substituting a `~' for a users home directory path.
  1932. X.PP
  1933. X.TP
  1934. X.B %u
  1935. Replaced with the number of users currently logged into the system.
  1936. X.PP
  1937. X.TP
  1938. X.B %U
  1939. Replaced with a list of the users logged in.
  1940. X.PP
  1941. X.TP
  1942. X.B %l
  1943. Replaced by the number of times the user is logged in.
  1944. X.PP
  1945. X.TP
  1946. X.B %n
  1947. Replaced with an `*' or the second word in the
  1948. X.I mailnotice
  1949. variable when you have new mail, or nothing at all when you do not have
  1950. new mail.
  1951. X.PP
  1952. X.TP
  1953. X.B %i
  1954. Begins standout mode.
  1955. X.PP
  1956. X.TP
  1957. X.B %I
  1958. XEnds standout mode.
  1959. X.PP
  1960. X.TP
  1961. X.B %<\fITC\fP>
  1962. Where <\fITC\fP> is one of the known terminal capabilities, therefore:
  1963. SO, SE, CE, KS, KE, DC, IC, DS, TC, FS and HS.
  1964. X.PP
  1965. X.TP
  1966. X.B %%
  1967. Replaced with a single percent `%'.
  1968. X.PP
  1969. X
  1970. X.SH SSH ARGUMENTS
  1971. X
  1972. If argument zero is a dash `-', then the shell is taken to be a login
  1973. shell.
  1974. X.I Ssh
  1975. interprets the following arguments:
  1976. X.TP
  1977. X.B -c
  1978. The next word is executed as a command.
  1979. X.PP
  1980. X.TP
  1981. X.B -e
  1982. The shell exits if any command terminates abnormally or returns a non-zero
  1983. exit status.
  1984. X.PP
  1985. X.TP
  1986. X.B -f
  1987. The shell skips sourcing of the the
  1988. X.I .sshrc
  1989. file in the users home directory, making it start faster.
  1990. X.PP
  1991. X.TP
  1992. X.B -n
  1993. Commands are parsed, but not executed.
  1994. X.PP
  1995. X.TP
  1996. X.B -t
  1997. A single line is read and executed.
  1998. X.PP
  1999. X.TP
  2000. X.B -x
  2001. Causes the
  2002. X.I echo
  2003. variable to be set, echoing commands before execution and after all parsing
  2004. is done.
  2005. X.PP
  2006. X.TP
  2007. X.B -X
  2008. As with -x, except that echoing begins even before the system
  2009. X.I .sshrc
  2010. file is sourced.
  2011. X.PP
  2012. X.TP
  2013. X.B -v
  2014. Sets the verbose variable, which echoes commands before any parsing is done
  2015. to the commands.
  2016. X.PP
  2017. X.TP
  2018. X.B -V
  2019. Is to -v what -X is to -x.
  2020. X.PP
  2021. X
  2022. X.SH AUTHORS
  2023. X
  2024. Steve Baker (ice@judy.indstate.edu)
  2025. X.br
  2026. X  and
  2027. X.br
  2028. Thomas Moore (dark@judy.indstate.edu)
  2029. X.br
  2030. X  - Wildcard routines (wc.c)
  2031. X.br
  2032. X
  2033. X.SH FILES
  2034. X
  2035. X/etc/.sshrc       Read first at startup.
  2036. X.br
  2037. X~/.login          Read by login shells after `/etc/.sshrc'.
  2038. X.br
  2039. X~/.sshrc          Read at startup after `~/.login'.
  2040. X.br
  2041. X~/.logout         Read by login shells at logout.
  2042. X.br
  2043. X~/.hist           History save file.
  2044. X.br
  2045. X~/.second         Secondary password store.
  2046. X.br
  2047. X~/.warning        Failed second-password login notification.
  2048. X.br
  2049. X/etc/passwd       Source of home dirs for `~'.
  2050. X.br
  2051. X/etc/utmp         Source for finding current logins.
  2052. X.br
  2053. X/etc/termcap      Source for terminal capabilities.
  2054. X.br
  2055. X/dev/null         Auto-redirect file for background jobs.
  2056. X.br
  2057. X
  2058. X.SH BUGS AND LIMITATIONS
  2059. X
  2060. X.TP 4
  2061. X1.
  2062. Words can be no more than 1024 characters. System limit of 10240 byte
  2063. commands, except for shell builtins.
  2064. X.PP
  2065. X.TP 4
  2066. X2.
  2067. Should maintain a "current job" pointer or maintain a restart priority
  2068. within the process table.
  2069. X.PP
  2070. X.TP 4
  2071. X3.
  2072. Behavior for deciding what gets alias substituted is screwy. Since alias
  2073. substitution is only performed once, the following shouldn't work:
  2074. X.br
  2075. X    > alias more less
  2076. X.br
  2077. X    > alias x (cat yyy | more)
  2078. X.br
  2079. X    > x  # will yield:
  2080. X.br
  2081. X    > cat yyy | less
  2082. X.br
  2083. The ``| more'' was parsed as an alias before it was put into the alias `x',
  2084. so it became `less' instead of the `more' it should have been.  The parens
  2085. failed to stop the alias parsing like they should do.  Not too sure if this
  2086. X{-eally should be fixed!
  2087. X.PP
  2088. X.TP 4
  2089. X4.
  2090. Should allow a secondary index for string variables to examine individual
  2091. characters of a word. And should be able to use indexes when assigning values
  2092. to string variables.
  2093. X.PP
  2094. X.TP 4
  2095. X5.
  2096. In expressions, operators do not necessarily have the same precedence as
  2097. they do in C. Parens should be used when in doubt about precedence.
  2098. X.PP
  2099. X.TP 4
  2100. X6.
  2101. Limit should be a little more intelligent with reguards to setting the
  2102. limits, by allowing size parameters like csh's limit.
  2103. X.PP
  2104. X.TP 4
  2105. X7.
  2106. The shell really needs to understand more terminal capabilities to
  2107. improve efficiency. The shell also makes pessimistic assumptions
  2108. like backspace is always ascii 8, and carriage return doesn't cause a
  2109. newline.
  2110. X.PP
  2111. X.TP 4
  2112. X8.
  2113. A special string malloc'er should be made for the shells amazing about
  2114. of small mallocs.
  2115. X.PP
  2116. X.TP 4
  2117. X9.
  2118. Ssh's command line editor doesn't understand that most terminals have a
  2119. maximum line width shorter than the 256 input buffer, and so it should be a
  2120. little smarter and try and pull the cursor back up to the end of the
  2121. previous line when you backspace at the beginning of the line.
  2122. X.PP
  2123. X.TP 4
  2124. X10.
  2125. When a job is stopped in a shell script, the script should stop as well
  2126. and when restarted, the script should attempt to restart the stopped job
  2127. and continue normally.
  2128. X.PP
  2129. X.TP 4
  2130. X11.
  2131. And many many more little things.
  2132. X.PP
  2133. X
  2134. X.SH SEE ALSO
  2135. sh(1), csh(1), tcsh(1), clam(1), zsh(1)
  2136. END_OF_FILE
  2137. if test 57433 -ne `wc -c <'ssh.1'`; then
  2138.     echo shar: \"'ssh.1'\" unpacked with wrong size!
  2139. fi
  2140. # end of 'ssh.1'
  2141. fi
  2142. echo shar: End of archive 4 \(of 4\).
  2143. cp /dev/null ark4isdone
  2144. MISSING=""
  2145. for I in 1 2 3 4 ; do
  2146.     if test ! -f ark${I}isdone ; then
  2147.     MISSING="${MISSING} ${I}"
  2148.     fi
  2149. done
  2150. if test "${MISSING}" = "" ; then
  2151.     echo You have unpacked all 4 archives.
  2152.     rm -f ark[1-9]isdone
  2153. else
  2154.     echo You still need to unpack the following archives:
  2155.     echo "        " ${MISSING}
  2156. fi
  2157. ##  End of shell archive.
  2158. exit 0
  2159.